﻿using UnityEditor;
using UnityEngine;

namespace QFramework
{
    [CustomEditor(typeof(StateControl))]
    public class StateControlEditor : UnityEditor.Editor {

        SerializedProperty m_OneProperty;
        SerializedProperty m_TwoProperty;
        SerializedProperty m_ThreeProperty;

        void OnEnable()
        {
            m_OneProperty = serializedObject.FindProperty("m_FsmName");
            m_TwoProperty = serializedObject.FindProperty("m_Description");
            m_ThreeProperty = serializedObject.FindProperty("m_ResetEnable");
        }

        public override void OnInspectorGUI()
        {
            EditorGUILayout.BeginVertical();

            m_OneProperty.stringValue = EditorGUILayout.TextField(m_OneProperty.stringValue);
            m_TwoProperty.stringValue = EditorGUILayout.TextArea(m_TwoProperty.stringValue, GUILayout.Height(60f));

            EditorGUILayout.BeginHorizontal();
          
            m_ThreeProperty.boolValue = EditorGUILayout.Toggle(m_ThreeProperty.boolValue);
            EditorGUILayout.LabelField("ResetEnable");
            EditorGUILayout.EndHorizontal();

            if (GUI.changed)
            {
                serializedObject.ApplyModifiedProperties();
            }
            EditorGUILayout.EndVertical();
        }


    }
}
